﻿using System;
using CultivationSkills.Utils;
using ThunderRoad;
using ThunderRoad.Pools;
using UnityEngine;
using UnityEngine.ResourceManagement.ResourceLocations;

namespace CultivationSkills
{
    public class ScriptsEntryPoint : ThunderScript
    {
        public override void ScriptEnable()
        {
            base.ScriptEnable();
            MyAssets.Load();
            MySkillTree.Load();
            EventManager.OnPlayerPrefabSpawned += () =>
            {
                Debug.Log("OnPlayerPrefabSpawned:" + Player.local);
                if (Player.local)
                {
                    Debug.Log(Player.local.head);
                }
            };
            EventManager.onCreatureSpawn += creature =>
            {
                Debug.Log("OnCreatureSpawn:" + creature + " isPlayer" + creature.isPlayer);
            };
        }

        public override void ScriptDisable()
        {
            base.ScriptDisable();
            MyAssets.Clear();
            MySkillTree.Clear();
        }
    }
}